<%@ page import="servlet.inquire"%>
<%@ page import="Data.data" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
    <title>信息查询内容</title>

    <style type="text/css">

        td,th{
            text-align: center;
        }

 body {
  background-color: #f0ece9;
}

header {
  display: flex;
  flex-flow: row nowrap;
  justify-content: space-between;
}
header h1 {
  color: #9a9897;
}

header hr {
  margin: 20px 20px 0;
  background-color: #bc9470;
  border: 2px solid #bc9470;
  width: 30%;
  height: 0;
}
        span
            {
                float: left;
                margin-left: 50px;
                margin-top: 50px;
                width: 220px;
                height: 480px;
                border: 3px solid #b4aea9;
            }
        a:link
            {
                color:black;
                font-size: 30px;
                font-family: Arial;
            }
        a:hover
            {
                color: red;
            }
        a
            {
                margin-left: 20px;
            }
        .first
            {
                width: 1200px;
                height: 550px;
                border: 1.5px solid #b4aea9;
                margin-left: 300px;
                margin-top: 34px;
                padding-left: 20px;
            }
  
            table {
  margin: 0 auto;
  width: 90%;
  text-align: center;
  border-spacing: 0;
}
table tbody tr:first-of-type {
  background-color: #dadee1 !important;
  height: 60px;
}
table tbody tr {
  height: 45px;
}
table tbody tr:nth-child(odd) {
  background-color: #eef1f8;
}
table tbody tr:nth-child(even) {
  background-color: #ffffff;
}
table tbody tr:not([id=thead]):hover {
  cursor: pointer;
  background-color: #e9e9e9;}

    </style>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
 <title>订单管理系统</title>
 <script src="js/test.js" type="text/javascript" charset="utf-8"></script>
 <script type="text/javascript"  src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script>
  <script>  doDelete(id)
  {
      location.href='/delete?id='+id}

  function doModify(id) {
      location.href='/updata?id='+id}
  </script>

</head>

<body>
    <header>
        <hr/>
  
        <h1>订单信息管理系统</h1>
        <hr/>
    </header>
    <div>

        <span>
            <br><br><a href="/freshdata">订单管理</a><br><br><br>
            <a href="input9.jsp">订单信息录入</a><br><br><br>
            <a href="/history">历史订单</a><br><br><br>
            <a href="login9.jsp">退出登录</a><br>
        </span>
    </div>

<div class="first">

<div class="container">

    <header>
        <hr/>
  
        <h3 align="center" style="color: #9a9897;">查询信息内容</h3>
        <hr/>
    </header>


    <form id="form" method="post">
        <div style=" overflow-y: auto; height: 300px; width:1100px;">
        <table border="1" class="table table-bordered table-hover">
            <tr class="success">
                <th>订单ID</th>
                <th>商品名字</th>
                <th>商品价格</th>
                <th>时间</th>
                <th>商品状态</th>
                <th>操作</th>
            </tr>
            <%
                List<data> dataList =(List<data>)request.getAttribute("goodmessage");
                for (data datas :dataList)
                {

            %>
            <tr>
                <td><%=datas.getGoodsid()%></td>
                <td><%=datas.getGoodsname()%></td>
                <td><%=datas.getGoodsprice()%></td>
                <td><%=datas.getGoodstime()%></td>
                <td><%=datas.getGoodsstatus()%></td>
                <td>
                    <button type="button" class="btn btn-primary" onclick="doModify(<%=datas.getGoodsid()%>)">修改</button>
                    <button type="button" class="btn btn-danger" onclick="doDelete(<%=datas.getGoodsid()%>")>删除</button>
                </td>
            </tr>

            <%
                }
            %>


        </table>
        </div>
    </form>
  
    <div align="center">
    
      <button class="btn  btn-info" type="submit" onclick="window.location.href = '/freshdata'">返回首页</button>
 
    </div>
</div>
</div>

</body>

    <script>
         document.getElementById("check").onclick = function(){
        var checked = document.getElementById("check").checked;
        var checkson = document.getElementsByName("uid");
        if(checked){
            for(var i = 0; i < checkson.length ;i++){
                checkson[i].checked = true;
            }
        }else{
            for(var i = 0; i < checkson.length ;i++){
                checkson[i].checked = false;
            }
        }
    }

    </script>
    <script src="js/jquery-1.10.2.min.js"></script>
    <script type="text/javascript">
        //obj是点击行的this
        function deleteTr(obj) {
            //通过this找到父级元素节点
            var tr = obj.parentNode.parentNode;
            //找到表格
            var tbody = tr.parentNode;
            //删除行
            tbody.removeChild(tr);
            //只剩行首时删除表格
            if (tbody.rows.length == 1) {
                tbody.parentNode.removeChild(tbody);
            }
        }
    
    </script>
        
</html>